<template>
  <el-row :gutter="10">
    <el-col :xs="24" :sm="12" :md="8" :lg="8">
      <div class="grid-content">
        <ChartPeople chart-id="ChartPeople" :chart-data="peopleData"></ChartPeople>
      </div>
    </el-col>
     <el-col :xs="24" :sm="12" :md="8" :lg="8">
      <div class="grid-content">
        <ChartMoney chart-id="ChartMoney" :chart-data="moneyData"></ChartMoney>
      </div>
    </el-col>
  </el-row>
</template>

<script lang="ts">
import { defineComponent,reactive } from 'vue'
import ChartPeople from './ChartPeople.vue'
import ChartMoney from './ChartMoney.vue'
export default defineComponent({
  components:{ChartPeople,ChartMoney},
 setup() {
    const peopleData = reactive({
      xdata:['一季度','二季度','三季度','四季度'],
      rdata:[12,15,5,3],
      ldata:[5,20,1,4]
    })
    const moneyData = reactive([
      {value: 148, name: '搜索引擎'},
      {value: 735, name: '直接访问'},
      {value: 580, name: '邮件营销'},
      {value: 484, name: '联盟广告'},
      {value: 300, name: '视频广告'}
    ])
    return {
      peopleData,
      moneyData
    }
  }

})
</script>

<style lang="scss" scoped>
.grid-content {
    background-color: #fff;
    border-radius: 2px;
    overflow: hidden;
    padding: 12px;
    display: flex;
    height: 320px;
    align-items: center;
    margin-bottom: 10px;
  }
</style>
